import CURDHelper from '@/utils/CURDHelper'
import PageConfig from '@/utils/pageConfig'
import { getBtnCtr } from '@/utils/BtnControl'
import Query from '@/components/Query';
import { isNumber } from '@/utils/validate';
import { VxeUI } from 'vxe-pc-ui';
import XEUtils from 'xe-utils';
export default {
  name: 'ProjectFinance',
  components: {
    Query
  },
  data() {
    const skztItemRender = {
      name: 'VxeSelect',
      options: [
        { label: '未收款', value: 'N' },
        { label: '已收款', value: 'Y' }
      ],
    }
    const kpztItemRender = {
      name: 'VxeSelect',
      options: [
        { label: '未开票', value: 'N' },
        { label: '已开票', value: 'Y' }
      ],
    }
    const kzztItemRender = {
      name: 'VxeSelect',
      options: [
        { label: '未支付', value: 'N' },
        { label: '已支付', value: 'Y' }
      ],
    }
    const kzlxItemRender = {
      name: 'VxeSelect',
      options: [
        { label: '差旅费用', value: '差旅' },
        { label: '返款', value: '返款' },
        { label: '其他', value: '其他' }

      ],
    }
    const qdItemRender = {
      name: 'VxeSelect',
      options: [
      ],
    }
    return {
      skztItemRender,
      kpztItemRender,
      kzztItemRender,
      kzlxItemRender,
      componentSize: PageConfig.ComponentSize,
      duration: PageConfig.Duration,
      btnPromission: '',
      activeName: 'first',
      editModal: false,
      QueryConditions: [],
      BaseApiUrl: '/api/Xmglxmxx',
      BaseChildApiUrl: '/api/Xmglxmxxsk',
      KpApiUrl: '/api/Xmglxmxxkp',
      KzApiUrl: '/api/Xmglxmxxkz',
      KdApiUrl: '/api/Xmglxmxxkd',
      editRow: undefined,
      CalendarView: false,
      QueryConfig: [{
        title: '客户名称',
        field: 'khmc',
        type: 'input',
        value: '',
        placeholder: '请输入客户名称以查询',
      }, {
        title: '体系名称',
        field: 'khmc',
        type: 'input',
        value: '',
        placeholder: '请输入体系名称以查询',
      },{
        title: '合同号',
        field: 'erpbh',
        type: 'input',
        value: '',
        placeholder: '请输入合同号以查询',
      }, {
        title: '签单日期',
        field: 'htqdrq',
        type: 'daterange',
        date1: undefined,
        date2: undefined,
        placeholder: ''
      }, {
        title: '收款状态',
        field: 'skzt',
        type: 'select',
        value: '',
        placeholder: '',
        options: [
          { label: '未收款', value: 'N' },
          { label: '已收款', value: 'Y' }
        ]
      }, {
        title: '开票状态',
        field: 'kpzt',
        type: 'select',
        value: '',
        placeholder: '',
        options: [
          { label: '未开票', value: 'N' },
          { label: '已开票', value: 'Y' }
        ]
      },],
      GridOptions: {
        id: 'ProjectReceiveMainGrid',
        border: true,
        stripe: true,
        loading: false,
        size: PageConfig.ComponentSize,
        height: 400,
        columnConfig: {
          resizable: true
        },
        rowConfig: {
          isHover: true,
          isCurrent: true
        },
        checkboxConfig: {
          highlight: true,
          range: true
        },
        exportConfig: {
        },
        toolbarConfig: {
          custom: true,
        },
        customConfig: {
          mode: 'drawer',
          storage: true
        },
        columns: [
          { type: 'seq', width: 50 },
          { type: 'checkbox', width: 35 },
          { field: 'txid', title: '体系ID', visible: false },
          { field: 'erpbh', title: '合同号', minWidth: 100, showOverflow: true },
          { field: 'khmc', title: '客户名称', sortable: true, minWidth: 120, showOverflow: true },
          { field: 'qdmc', title: '渠道名称', minWidth: 120, showOverflow: true },
          { field: 'txmc', title: '体系名称', sortable: true, minWidth: 120, showOverflow: true },
          { field: 'txgg', title: '体系规格', minWidth: 100, showOverflow: true },
          { field: 'rzbz', title: '认证标准', minWidth: 120, showOverflow: true },
          { field: 'skzt', title: '收款状态', minWidth: 120, showOverflow: true, slots: { default: 'receiveStatus' } },
          { field: 'skqrr', title: '收款确认人', minWidth: 120, showOverflow: true },
          { field: 'skqrsj', title: '收款确认时间', minWidth: 120, showOverflow: true, },
          { field: 'kpzt', title: '开票状态', minWidth: 120, showOverflow: true, slots: { default: 'invoiceStatus' } },
          { field: 'kpqrr', title: '开票确认人', minWidth: 120, showOverflow: true },
          { field: 'kpqrsj', title: '开票确认时间', minWidth: 120, showOverflow: true, },          
          { field: 'sxq', title: '市县区', minWidth: 120, showOverflow: true },
          { field: 'shlx', title: '审核类型', minWidth: 100, showOverflow: true },
          { field: 'rzfw', title: '认证范围', minWidth: 100, showOverflow: true },
          { field: 'txrs', title: '体系人数', minWidth: 80, showOverflow: true },
          { field: 'csje', title: '初审金额', minWidth: 80, showOverflow: true },
          { field: 'jsje', title: '监审金额', minWidth: 80, showOverflow: true },
          {
            field: 'htqdrq', title: '签单日期', sortable: true, minWidth: 120, showOverflow: true,
            formatter: ({ cellValue }) => XEUtils.toDateString(cellValue, 'yyyy-MM-dd')
          },
          { field: 'createtime', title: '创建时间', width: 120, showOverflow: true },
          { field: 'createname', title: '创建人', width: 60, showOverflow: true },
          { field: 'updatetime', title: '更新时间', width: 150, showOverflow: true },
          { field: 'updatename', title: '更新人', width: 60, showOverflow: true },
          { field: 'operation', title: '操作', fixed: 'right', width: 160, slots: { default: 'operation' } },
        ],
        data: []
      },
      PagerConfig: {
        align: 'center',
        pageSize: 25,
        total: 0,
        currentPage: 1,
        pageSizes: [10, 25, 50, 100, 200],
      },
      ReceiveGridOptions: {
        id: 'ProjectReceiveChildGrid',
        border: true,
        stripe: true,
        loading: false,
        size: PageConfig.ComponentSize,
        height: 300,
        columnConfig: {
          resizable: true
        },
        rowConfig: {
          isHover: true,
          isCurrent: true
        },
        editConfig: {
          trigger: 'click',
          mode: 'row',
          showStatus: true
        },
        exportConfig: {
        },
        toolbarConfig: {
          tools: [
            { code: 'childAdd', icon: 'vxe-icon-add', circle: true }
          ]
        },
        customConfig: {
          mode: 'drawer',
          storage: true
        },
        columns: [
          { type: 'seq', width: 50 },
          { field: 'skxm', title: '收款项', minWidth: 200, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'ysrq', title: '应收日期', minWidth: 120, showOverflow: true, editRender: { name: 'VxeDatePicker', props: { type: 'date' } } },
          { field: 'skje', title: '应收金额', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skzt', title: '收款状态', minWidth: 90, showOverflow: true, slots: { default: 'receiveStatus' }, editRender: skztItemRender },
          { field: 'ssje', title: '实收金额', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skr', title: '收款人', minWidth: 80, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skrq', title: '收款日期', minWidth: 150, showOverflow: true, editRender: { name: 'VxeDatePicker', props: { type: 'date' } } },
          { field: 'bz', title: '备注', minWidth: 150, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'operation', title: '操作', fixed: 'right', width: 120, slots: { default: 'operation' } },
        ],
        data: []
      },
      ReceiveGridOptions2: {
        id: 'ProjectReceiveChildGrid2',
        border: true,
        stripe: true,
        loading: false,
        size: PageConfig.ComponentSize,
        height: 600,
        columnConfig: {
          resizable: true
        },
        rowConfig: {
          isHover: true,
          isCurrent: true
        },
        editConfig: {
          trigger: 'click',
          mode: 'row',
          showStatus: true
        },
        customConfig: {
          mode: 'drawer',
          storage: true
        },
        columns: [
          { type: 'seq', width: 50 },
          { field: 'khmc', title: '客户名称', minWidth: 150, showOverflow: true },
          { field: 'skxm', title: '收款项', minWidth: 200, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'ysrq', title: '应收日期', minWidth: 120, showOverflow: true, editRender: { name: 'VxeDatePicker', props: { type: 'date' } } },
          { field: 'skje', title: '应收金额', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skzt', title: '收款状态', minWidth: 90, showOverflow: true, slots: { default: 'receiveStatus' }, editRender: skztItemRender },
          { field: 'ssje', title: '实收金额', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skr', title: '收款人', minWidth: 80, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skrq', title: '收款日期', minWidth: 150, showOverflow: true, editRender: { name: 'VxeDatePicker', props: { type: 'date' } } },
          { field: 'bz', title: '备注', minWidth: 150, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'operation', title: '操作', fixed: 'right', width: 120, slots: { default: 'operation' } },
        ],
        data: []
      },
      InvoiceGridOptions: {
        id: 'ProjectInvoiceChildGrid',
        border: true,
        stripe: true,
        loading: false,
        size: PageConfig.ComponentSize,
        height: 300,
        columnConfig: {
          resizable: true
        },
        rowConfig: {
          isHover: true,
          isCurrent: true
        },
        editConfig: {
          trigger: 'click',
          mode: 'row',
          showStatus: true
        },
        exportConfig: {
        },
        toolbarConfig: {
          tools: [
            { code: 'childAdd', icon: 'vxe-icon-add', circle: true }
          ]
        },
        customConfig: {
          mode: 'drawer',
          storage: true
        },
        columns: [
          { type: 'seq', width: 50 },
          { field: 'kpxm', title: '开票项', minWidth: 200, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'kpje', title: '应开金额', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'kpzt', title: '开票状态', minWidth: 90, showOverflow: true, slots: { default: 'invoiceStatus' }, editRender: kpztItemRender },
          { field: 'skje', title: '实开金额', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'fph', title: '发票号', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'kpr', title: '开票人', minWidth: 80, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'kprq', title: '开票日期', minWidth: 120, showOverflow: true, editRender: { name: 'VxeDatePicker', props: { type: 'date' } } },
          { field: 'bz', title: '备注', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'operation', title: '操作', fixed: 'right', width: 120, slots: { default: 'operation' } },
        ],
        data: []
      },
      ExpensesGridOptions: {
        id: 'ProjectExpensesChildGrid',
        border: true,
        stripe: true,
        loading: false,
        size: PageConfig.ComponentSize,
        height: 300,
        columnConfig: {
          resizable: true
        },
        rowConfig: {
          isHover: true,
          isCurrent: true
        },
        editConfig: {
          trigger: 'click',
          mode: 'row',
          showStatus: true
        },
        exportConfig: {
        },
        toolbarConfig: {
          tools: [
            { code: 'childAdd', icon: 'vxe-icon-add', circle: true }
          ]
        },
        customConfig: {
          mode: 'drawer',
          storage: true
        },
        columns: [
          { type: 'seq', width: 50 },
          { field: 'kzxm', title: '开支项', minWidth: 200, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'kzje', title: '金额', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'kzzt', title: '支付状态', minWidth: 90, showOverflow: true, slots: { default: 'expensesStatus' }, editRender: kzztItemRender },
          { field: 'kzlx', title: '费用类型', minWidth: 90, showOverflow: true, editRender: kzlxItemRender },
          { field: 'kzsj', title: '发生时间', minWidth: 90, showOverflow: true, editRender: { name: 'VxeDatePicker', props: { type: 'date' } } },
          { field: 'skf', title: '收款方', minWidth: 120, showOverflow: true, 
            editRender: { name: 'VxeInput' , props:{ type:'search' } ,events:{'search-click': 
              e => {
                  this.ExpensesEditRow = e.row;
                  this.GetSupplierData();
                  this.qdModal = true;
                }
            }}},
          { field: 'skyh', title: '收款银行', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skzh', title: '收款账号', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'skhm', title: '户名', minWidth: 80, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'qdid', title: '渠道ID', visible:false},
          { field: 'bz', title: '备注', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'operation', title: '操作', fixed: 'right', width: 120, slots: { default: 'operation' } },
        ],
        data: []
      },
      ExpressGridOptions: {
        id: 'ProjectExpressChildGrid',
        border: true,
        stripe: true,
        loading: false,
        size: PageConfig.ComponentSize,
        height: 300,
        columnConfig: {
          resizable: true
        },
        rowConfig: {
          isHover: true,
          isCurrent: true
        },
        editConfig: {
          trigger: 'click',
          mode: 'row',
          showStatus: true
        },
        exportConfig: {
        },
        toolbarConfig: {
          tools: [
            { code: 'childAdd', icon: 'vxe-icon-add', circle: true }
          ]
        },
        customConfig: {
          mode: 'drawer',
          storage: true
        },
        columns: [
          { type: 'seq', width: 50 },
          { field: 'kdh', title: '快递号', minWidth: 150, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'kdgs', title: '快递公司', minWidth: 150, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'fjr', title: '发件人', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'fjsj', title: '发件时间', minWidth: 90, showOverflow: true, editRender: { name: 'VxeDatePicker', props: { type: 'date' } } },
          { field: 'sjr', title: '收件人', minWidth: 90, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'sjrdh', title: '收件人电话', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'sjdz', title: '收件地址', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'bz', title: '备注', minWidth: 120, showOverflow: true, editRender: { name: 'VxeInput' } },
          { field: 'operation', title: '操作', fixed: 'right', width: 120, slots: { default: 'operation' } },
        ],
        data: []
      },
      SupplierGridOptions: {
        id: 'ProjectSupplierChildGrid',
        border: true,
        stripe: true,
        loading: false,
        size: PageConfig.ComponentSize,
        height: 300,
        columnConfig: {
          resizable: true
        },
        rowConfig: {
          isHover: true,
          isCurrent: true
        },        
        columns: [
          { type: 'seq', width: 50 },
          { field: 'qdmc', title: '渠道名称', minWidth: 150, showOverflow: true, filters: [{ data: '' }], filterRender: {name:'VxeInput'}},
          { field: 'yhmc', title: '银行名称', minWidth: 150, showOverflow: true},
          { field: 'yhzh', title: '银行账号', minWidth: 200, showOverflow: true},
          { field: 'hm', title: '户名', minWidth: 90, showOverflow: true },
          { field: 'operation', title: '操作', fixed: 'right', width: 60, slots: { default: 'operation' } },
        ],
        data: []
      },
      dskModal:false,
      qdModal:false,
      ExpensesEditRow:undefined,
    }
  },
  created() {
    // 动态头部按钮
    this.btnPromission = getBtnCtr(
      this.$route.path,
      this.$store.getters.userPermission
    )
  },
  mounted(){
    
    if(this.$route.query.isdashboard){
      //首页跳转过来的，查询所有待收款信息，并可以录入
      this.DoReceiveQuery2();
      this.dskModal = true;
    }
    
  },
  methods: {
    handleQuery(e) {
      this.QueryConditions = e;
      this.DoQuery(e);
    },
    handleTabClick() {
      if (!this.editRow) {
        VxeUI.modal.message({ content: '请选择点击选择项目信息后，查看或操作相关明细信息', status: 'error', duration: this.duration });
        return;
      }
      let queryConditions = [{
        column: 'xmid',
        content: this.editRow.id,
        condition: '0'
      }]
      switch (this.activeName) {
        case 'first':
          this.DoReceiveQuery(queryConditions);
          break;
        case 'second':
          this.DoExpensesQuery(queryConditions);
          break;
        case 'third':
          this.DoInvoiceQuery(queryConditions);
          break;
        case 'fourth':
          this.DoExpressQuery(queryConditions);
          break;
      }
    },
    handlePageChange() {
      this.DoQuery(this.QueryConditions);
    },
    handleReceiveCancel() {
      this.$refs.receiveGrid.clearEdit();
    },
    handleReceiveCancel2() {
      this.$refs.receiveGrid2.clearEdit();
    },
    hasReceiveEditStatus(row) {
      return this.$refs.receiveGrid.isEditByRow(row);
    },
    hasReceiveEditStatus2(row) {
      return this.$refs.receiveGrid2.isEditByRow(row);
    },
    handleReceiveSave(row) {
      this.$refs.receiveGrid.clearEdit();
      if (!row.skxm || row.skxm.length < 1) {
        VxeUI.modal.message({ content: '请填写收款项', status: 'error', duration: this.duration });
        return;
      }
      if (!row.ysrq || row.ysrq.length < 1) {
        VxeUI.modal.message({ content: '请填写应收日期', status: 'error', duration: this.duration });
        return;
      }
      
      if (!row.skje && row.skje.length < 1) {
        VxeUI.modal.message({ content: '请填写应收金额', status: 'error', duration: this.duration });
        return;
      }
      row.id == 0 ? this.DoReceiveAdd(row) : this.DoReceiveEdit(row);
    },
    handleReceiveSave2(row) {
      this.$refs.receiveGrid2.clearEdit();
      if (!row.skxm || row.skxm.length < 1) {
        VxeUI.modal.message({ content: '请填写收款项', status: 'error', duration: this.duration });
        return;
      }
      if (!row.ysrq || row.ysrq.length < 1) {
        VxeUI.modal.message({ content: '请填写应收日期', status: 'error', duration: this.duration });
        return;
      }
      
      if (!row.skje && row.skje.length < 1) {
        VxeUI.modal.message({ content: '请填写应收金额', status: 'error', duration: this.duration });
        return;
      }
      this.DoReceiveEdit2(row);
    },
    handleReceiveToolClick({ code }) {
      if (!this.editRow) {
        VxeUI.modal.message({ content: '请选择要收款的项目', status: 'error', duration: this.duration })
        return;
      }
      if (this.editRow.skzt == 'Y') {
        VxeUI.modal.message({ content: '该项目已确认收款，不能再操作', status: 'error', duration: this.duration })
        return;
      }
      if (code == 'childAdd') {
        this.ReceiveGridOptions.data.push({
          id: 0,
          xmid: this.editRow.id,
          skxm: '',
          ysrq: '',
          skje: 0,
          skzt: 'N',
          ssje: 0,
          skr: '',
          skrq: '',
          bz:''
        })
      }
    },
    handleMainGridCellClick({ row }) {
      this.editRow = row;
      let queryConditions = [{
        column: 'xmid',
        content: row.id,
        condition: '0'
      }]
      switch (this.activeName) {
        case 'first':
          this.DoReceiveQuery(queryConditions);
          break;
        case 'second':
          this.DoExpensesQuery(queryConditions);
          break;
        case 'third':
          this.DoInvoiceQuery(queryConditions);
          break;
        case 'fourth':
          this.DoExpressQuery(queryConditions);
          break;
      }
    },
    handleReceiveConfirm(row) {
      this.DoAuditReceiveStatus(row);
    },
    handleReceiveEdit(row) {
      // if (row.skzt == 'Y') {
      //   VxeUI.modal.message({ content: '该款项已收款，不允许编辑', status: 'error', duration: this.duration })
      //   return;
      // }
      this.$refs.receiveGrid.setEditRow(row);
    },
    handleReceiveEdit2(row) {
      // if (row.skzt == 'Y') {
      //   VxeUI.modal.message({ content: '该款项已收款，不允许编辑', status: 'error', duration: this.duration })
      //   return;
      // }
      this.$refs.receiveGrid2.setEditRow(row);
    },
    handleReceiveDelete(row) {
      this.DoReceiveDelete(row);
    },
    DoQuery(e) {
      if (e) {
        e.push({ column: 'shzt', content: 'Y', condition: '0' })
      } else {
        e = [{ column: 'shzt', content: 'Y', condition: '0' }]
      }
      let request = {
        isPaging: true,
        pageSize: this.PagerConfig.pageSize,
        pageIndex: this.PagerConfig.currentPage,
        queryConditions: e,
        orderByConditions: [{
          column:'t.id',
          condition:'desc'
        }]
      }
      CURDHelper.Query(request, this.BaseApiUrl)
        .then(res => {
          this.GridOptions.data = res.data;
          this.PagerConfig.total = res.totalNumber;
          this.editRow = undefined;
          this.ReceiveGridOptions.data = []
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
    DoReceiveEdit(row) {
      this.$refs.receiveGrid.clearEdit();
      let postData = {
        id: row.id,
        ssje: row.ssje,
        skr: row.skr,
        skrq: row.skrq,
        skzt: row.skzt,
        bz:row.bz
      }

      if (postData.skzt == 'Y') {
        if (!postData.ssje && postData.ssje.length < 1) {
          VxeUI.modal.message({ content: '请填写实收金额', status: 'error', duration: this.duration })
          return;
        }
        if (!postData.skr || postData.skr.length < 1) {
          VxeUI.modal.message({ content: '请填写收款人', status: 'error', duration: this.duration })
          return;
        }
        if (!postData.skrq || postData.skrq.length < 1) {
          VxeUI.modal.message({ content: '请填写收款日期', status: 'error', duration: this.duration })
          return;
        }
        //CURDHelper.EditWithConfirm('是否确认该款项已收款，确认后不允许再编辑数据', postData, null, `${this.BaseChildApiUrl}`)
        CURDHelper.Edit(postData, null, `${this.BaseChildApiUrl}`)  
        .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoReceiveQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      } else {
        CURDHelper.Edit(postData, null, `${this.BaseChildApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoReceiveQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      }
    },
    DoReceiveEdit2(row) {
      this.$refs.receiveGrid2.clearEdit();
      let postData = {
        id: row.id,
        ssje: row.ssje,
        skr: row.skr,
        skrq: row.skrq,
        skzt: row.skzt,
        bz:row.bz
      }
      if (postData.skzt == 'Y') {
        if (!postData.ssje && postData.ssje.length < 1) {
          VxeUI.modal.message({ content: '请填写实收金额', status: 'error', duration: this.duration })
          return;
        }
        if (!postData.skr || postData.skr.length < 1) {
          VxeUI.modal.message({ content: '请填写收款人', status: 'error', duration: this.duration })
          return;
        }
        if (!postData.skrq || postData.skrq.length < 1) {
          VxeUI.modal.message({ content: '请填写收款日期', status: 'error', duration: this.duration })
          return;
        }
        //CURDHelper.EditWithConfirm('是否确认该款项已收款，确认后不允许再编辑数据', postData, null, `${this.BaseChildApiUrl}`)
        CURDHelper.Edit(postData, null, `${this.BaseChildApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })            
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      } else {
        CURDHelper.Edit(postData, null, `${this.BaseChildApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })            
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      }
    },
    DoReceiveQuery(e) {
      let queryConditions = e || [];
      let request = {
        isPaging: false,
        pageSize: 1,
        pageIndex: 1,
        queryConditions: queryConditions,
        orderByConditions: [{
          column: 'createtime',
          condition: 'asc'
        }]
      }
      CURDHelper.Query(request, this.BaseChildApiUrl)
        .then(res => {
          this.ReceiveGridOptions.data = res.data;
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
    DoReceiveQuery2() {
      let queryConditions = [{
        column:'t.skzt',
        content:'N',
        condition:'0'
      }];
      let request = {
        isPaging: false,
        pageSize: 1,
        pageIndex: 1,
        queryConditions: queryConditions,
        orderByConditions: [{
          column: 'createtime',
          condition: 'asc'
        }]
      }
      CURDHelper.Query(request, this.BaseChildApiUrl)
        .then(res => {
          this.ReceiveGridOptions2.data = res.data;
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
    DoReceiveAdd(row) {
      this.$refs.receiveGrid.clearEdit();
      if (row.skzt == 'Y') {
        if (!row.ssje || row.ssje.length < 1) {
          VxeUI.modal.message({ content: '请填写实收金额', status: 'error', duration: this.duration })
          return;
        }
        if (!row.skr || row.skr.length < 1) {
          VxeUI.modal.message({ content: '请填写收款人', status: 'error', duration: this.duration })
          return;
        }
        if (!row.skrq || row.skrq.length < 1) {
          VxeUI.modal.message({ content: '请填写收款日期', status: 'error', duration: this.duration })
          return;
        }
        CURDHelper.AddWithConfirm('是否确认该款项已收款，确认后不允许再编辑数据', row, null, `${this.BaseChildApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '新增数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoReceiveQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      } else {
        CURDHelper.Add(row, null, `${this.BaseChildApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '新增数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoReceiveQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      }
    },
    DoAuditReceiveStatus(row) {
      if (row.skzt == 'Y') {
        VxeUI.modal.message({ content: '该项目已收款确认，无需再操作', status: 'error', duration: this.duration });
        return;
      }
      let postData = { id: row.id, shzt: 'Y' };
      CURDHelper.EditWithConfirm('是否确认该项目已收款完成，确认后不允许再编辑数据', postData, null, `${this.BaseApiUrl}/ReceiveConfirm`)
        .then(res => {
          VxeUI.modal.message({ content: '操作成功', status: 'success', duration: this.duration });
          this.DoQuery(this.QueryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })

    },
    DoReceiveDelete(row) {
      if (this.editRow.skzt == 'Y') {
        VxeUI.modal.message({ content: '该款项已收款确认，不允许删除', status: 'error', duration: this.duration })
        return;
      }
      if (row.skzt == 'Y') {
        VxeUI.modal.message({ content: '该款项已收款确认，不允许删除', status: 'error', duration: this.duration })
        return;
      }
      //删除
      let deleteModel = {
        ID: row.id,
        DeleteRemark: ''
      };
      CURDHelper.DeleteWithConfirm('是否删除当前数据', deleteModel, null, this.BaseChildApiUrl)
        .then(res => {
          VxeUI.modal.message({ content: '删除数据成功', status: 'success', duration: this.duration })
          let queryConditions = [{
            column: 'xmid',
            content: this.editRow.id,
            condition: '0'
          }]
          this.DoReceiveQuery(queryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: err, status: 'error', duration: this.duration })
        })
    },
    handleInvoiceConfirm(row) {
      this.DoAuditInvoiceStatus(row);
    },
    DoAuditInvoiceStatus(row) {
      if (row.kpzt == 'Y') {
        VxeUI.modal.message({ content: '该项目已开票确认，无需再操作', status: 'error', duration: this.duration });
        return;
      }
      let postData = { id: row.id, shzt: 'Y' };
      CURDHelper.EditWithConfirm('是否确认该项目已开票完成，确认后不允许再编辑数据', postData, null, `${this.BaseApiUrl}/InvoiceConfirm`)
        .then(res => {
          VxeUI.modal.message({ content: '操作成功', status: 'success', duration: this.duration });
          this.DoQuery(this.QueryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })

    },
    handleInvoiceCancel() {
      this.$refs.invoiceGrid.clearEdit();
    },
    hasInvoiceEditStatus(row) {
      return this.$refs.invoiceGrid.isEditByRow(row);
    },
    handleInvoiceSave(row) {
      this.$refs.invoiceGrid.clearEdit();
      if (!row.kpxm || row.kpxm.length < 1) {
        VxeUI.modal.message({ content: '请填写开票项', status: 'error', duration: this.duration });
        return;
      }
      if (!row.kpje && row.kpje.length < 1) {
        VxeUI.modal.message({ content: '请填写开票金额', status: 'error', duration: this.duration });
        return;
      }
      row.id == 0 ? this.DoInvoiceAdd(row) : this.DoInvoiceEdit(row);
    },
    handleInvoiceToolClick({ code }) {
      if (!this.editRow) {
        VxeUI.modal.message({ content: '请选择要开票的项目', status: 'error', duration: this.duration })
        return;
      }
      if (this.editRow.kpzt == 'Y') {
        VxeUI.modal.message({ content: '该项目已确认开票，不能再操作', status: 'error', duration: this.duration })
        return;
      }
      if (code == 'childAdd') {
        this.InvoiceGridOptions.data.push({
          id: 0,
          xmid: this.editRow.id,
          kpxm: '',
          kpje: 0,
          kpzt: 'N',
          skje: 0,
          kpr: '',
          kprq: '',
          bz:''
        })
      }
    },
    handleInvoiceEdit(row) {
      if (row.kpzt == 'Y') {
        VxeUI.modal.message({ content: '该开票项已开票，不允许编辑', status: 'error', duration: this.duration })
        return;
      }
      this.$refs.invoiceGrid.setEditRow(row);
    },
    handleInvoiceDelete(row) {
      this.DoInvoiceDelete(row);
    },
    DoInvoiceEdit(row) {
      this.$refs.invoiceGrid.clearEdit();
      let postData = {
        id: row.id,
        kpzt: row.kpzt,
        skje: row.skje,
        kpr: row.kpr,
        kprq: row.kprq,
        bz:row.bz
      }

      if (postData.kpzt == 'Y') {
        if (!postData.skje || postData.skje.length < 1) {
          VxeUI.modal.message({ content: '请填写实开金额', status: 'error', duration: this.duration })
          return;
        }
        if (!postData.kpr || postData.kpr.length < 1) {
          VxeUI.modal.message({ content: '请填写开票人', status: 'error', duration: this.duration })
          return;
        }
        if (!postData.kprq || postData.kprq.length < 1) {
          VxeUI.modal.message({ content: '请填写开票日期', status: 'error', duration: this.duration })
          return;
        }
        CURDHelper.EditWithConfirm('是否确认该开票项已开票，确认后不允许再编辑数据', postData, null, `${this.KpApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoInvoiceQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      } else {
        CURDHelper.Edit(postData, null, `${this.KpApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoInvoiceQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      }
    },
    DoInvoiceQuery(e) {
      let queryConditions = e || [];
      let request = {
        isPaging: false,
        pageSize: 1,
        pageIndex: 1,
        queryConditions: queryConditions,
        orderByConditions: [{
          column: 'createtime',
          condition: 'asc'
        }]
      }
      CURDHelper.Query(request, this.KpApiUrl)
        .then(res => {
          this.InvoiceGridOptions.data = res.data;
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
    DoInvoiceAdd(row) {
      this.$refs.invoiceGrid.clearEdit();
      if (row.kpzt == 'Y') {
        if (!row.skje || row.skje.length < 1) {
          VxeUI.modal.message({ content: '请填写实开金额', status: 'error', duration: this.duration })
          return;
        }
        if (!row.kpr || row.kpr.length < 1) {
          VxeUI.modal.message({ content: '请填写开票人', status: 'error', duration: this.duration })
          return;
        }
        if (!row.kprq || row.kprq.length < 1) {
          VxeUI.modal.message({ content: '请填写开票日期', status: 'error', duration: this.duration })
          return;
        }
        CURDHelper.AddWithConfirm('是否确认该开票项已开票，确认后不允许再编辑数据', row, null, `${this.KpApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '新增数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoInvoiceQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      } else {
        CURDHelper.Add(row, null, `${this.KpApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '新增数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoInvoiceQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      }
    },
    DoInvoiceDelete(row) {
      if (this.editRow.kpzt == 'Y') {
        VxeUI.modal.message({ content: '该开票项已开票确认，不允许删除', status: 'error', duration: this.duration })
        return;
      }
      if (row.kpzt == 'Y') {
        VxeUI.modal.message({ content: '该开票项已开票确认，不允许删除', status: 'error', duration: this.duration })
        return;
      }
      //删除
      let deleteModel = {
        ID: row.id,
        DeleteRemark: ''
      };
      CURDHelper.DeleteWithConfirm('是否删除当前数据', deleteModel, null, this.KpApiUrl)
        .then(res => {
          VxeUI.modal.message({ content: '删除数据成功', status: 'success', duration: this.duration })
          let queryConditions = [{
            column: 'xmid',
            content: this.editRow.id,
            condition: '0'
          }]
          this.DoInvoiceQuery(queryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: err, status: 'error', duration: this.duration })
        })
    },
    handleExpensesCancel() {
      this.$refs.expensesGrid.clearEdit();
    },
    hasExpensesEditStatus(row) {
      return this.$refs.expensesGrid.isEditByRow(row);
    },
    handleExpensesSave(row) {
      this.$refs.expensesGrid.clearEdit();
      if (!row.kzxm || row.kzxm.length < 1) {
        VxeUI.modal.message({ content: '请填写开支项', status: 'error', duration: this.duration });
        return;
      }
      if (!row.kzlx || row.kzlx.length < 1) {
        VxeUI.modal.message({ content: '请选择开支类型', status: 'error', duration: this.duration });
        return;
      }
      if (!row.kzje && row.kzje.length < 1) {
        VxeUI.modal.message({ content: '请填写开支金额', status: 'error', duration: this.duration });
        return;
      }
      if (!row.kzsj || row.kzsj.length < 1) {
        VxeUI.modal.message({ content: '选择开支时间', status: 'error', duration: this.duration });
        return;
      }
      row.id == 0 ? this.DoExpensesAdd(row) : this.DoExpensesEdit(row);
    },
    handleExpensesToolClick({ code }) {
      if (!this.editRow) {
        VxeUI.modal.message({ content: '请选择要记录开支的项目', status: 'error', duration: this.duration })
        return;
      }
      if (code == 'childAdd') {
        this.ExpensesGridOptions.data.push({
          id: 0,
          xmid: this.editRow.id,
          kzxm: '',
          kzje: 0,
          kzzt: 'N',
          kzsj: 0,
          kzlx: '',
          skf: '',
          skyh: '',
          skzh: '',
          bz:''
        })
      }
    },
    handleExpensesEdit(row) {
      // if (row.kzzt == 'Y') {
      //   VxeUI.modal.message({ content: '该开支项已支付完成，不允许编辑', status: 'error', duration: this.duration })
      //   return;
      // }
      this.$refs.expensesGrid.setEditRow(row);
    },
    handleExpensesDelete(row) {
      this.DoExpensesDelete(row);
    },
    DoExpensesEdit(row) {
      this.$refs.expensesGrid.clearEdit();
      let postData = {
        id: row.id,
        xmid: row.xmid,
        kzxm: row.kzxm,
        kzlx: row.kzlx,
        kzje: row.kzje,
        kzsj: row.kzsj,
        kzzt: row.kzzt,
        skf: row.skf,
        skyh: row.skyh,
        skzh: row.skzh,
        bz:row.bz,
        qdid:row.qdid,
        skhm:row.skhm
      }
      if (postData.kzzt == 'Y') {
        //CURDHelper.EditWithConfirm('是否确认该开支项已支付，确认后不允许编辑', postData, null, `${this.KzApiUrl}`)
        CURDHelper.Edit(postData, null, `${this.KzApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoExpensesQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      } else {
        CURDHelper.Edit(postData, null, `${this.KzApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoExpensesQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      }
    },
    DoExpensesQuery(e) {
      let queryConditions = e || [];
      let request = {
        isPaging: false,
        pageSize: 1,
        pageIndex: 1,
        queryConditions: queryConditions,
        orderByConditions: [{
          column: 'createtime',
          condition: 'asc'
        }]
      }
      CURDHelper.Query(request, this.KzApiUrl)
        .then(res => {
          this.ExpensesGridOptions.data = res.data;
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
    DoExpensesAdd(row) {
      this.$refs.expensesGrid.clearEdit();
      if (row.kzzt == 'Y') {
        CURDHelper.AddWithConfirm('是否确认该开支项已支付，确认后不允许再编辑数据', row, null, `${this.KzApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '新增数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoExpensesQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      } else {
        CURDHelper.Add(row, null, `${this.KzApiUrl}`)
          .then(res => {
            VxeUI.modal.message({ content: '新增数据成功', status: 'success', duration: this.duration })
            let queryConditions = [{
              column: 'xmid',
              content: this.editRow.id,
              condition: '0'
            }]
            this.DoExpensesQuery(queryConditions);
          }).catch(err => {
            VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
          })
      }
    },
    DoExpensesDelete(row) {
      if (row.kzzt == 'Y') {
        VxeUI.modal.message({ content: '该开支项项已支付确认，不允许删除', status: 'error', duration: this.duration })
        return;
      }
      //删除
      let deleteModel = {
        ID: row.id,
        DeleteRemark: ''
      };
      CURDHelper.DeleteWithConfirm('是否删除当前数据', deleteModel, null, this.KzApiUrl)
        .then(res => {
          VxeUI.modal.message({ content: '删除数据成功', status: 'success', duration: this.duration })
          let queryConditions = [{
            column: 'xmid',
            content: this.editRow.id,
            condition: '0'
          }]
          this.DoExpensesQuery(queryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: err, status: 'error', duration: this.duration })
        })
    },
    handleExpressCancel() {
      this.$refs.expressGrid.clearEdit();
    },
    hasExpressEditStatus(row) {
      return this.$refs.expressGrid.isEditByRow(row);
    },
    handleExpressSave(row) {
      this.$refs.expressGrid.clearEdit();
      if (!row.kdh || row.kdh.length < 1) {
        VxeUI.modal.message({ content: '请填写快递号', status: 'error', duration: this.duration });
        return;
      }
      if (!row.fjr || row.fjr.length < 1) {
        VxeUI.modal.message({ content: '请填写发件人', status: 'error', duration: this.duration });
        return;
      }
      if (!row.fjsj || row.fjsj.length < 1) {
        VxeUI.modal.message({ content: '请选择发件时间', status: 'error', duration: this.duration });
        return;
      }
      if (!row.sjr || row.sjr.length < 1) {
        VxeUI.modal.message({ content: '请填写收件人', status: 'error', duration: this.duration });
        return;
      }
      if (!row.sjrdh || row.sjrdh.length < 1) {
        VxeUI.modal.message({ content: '请填写收件人电话', status: 'error', duration: this.duration });
        return;
      }
      if (!row.sjdz || row.sjdz.length < 1) {
        VxeUI.modal.message({ content: '请填写收件地址', status: 'error', duration: this.duration });
        return;
      }

      row.id == 0 ? this.DoExpressAdd(row) : this.DoExpressEdit(row);
    },
    handleExpressToolClick({ code }) {
      if (!this.editRow) {
        VxeUI.modal.message({ content: '请选择要记录快递信息的项目', status: 'error', duration: this.duration })
        return;
      }
      if (code == 'childAdd') {
        this.ExpressGridOptions.data.push({
          id: 0,
          xmid: this.editRow.id,
          kdh: '',
          fjr: '',
          fjsj: '',
          sjr: '',
          sjrdh: '',
          sjdz: '',
          kdgs: '',
          bz:''
        })
      }
    },
    handleExpressEdit(row) {
      this.$refs.expressGrid.setEditRow(row);
    },
    handleExpressDelete(row) {
      this.DoExpressDelete(row);
    },
    DoExpressEdit(row) {
      this.$refs.expressGrid.clearEdit();
      let postData = {
        id: row.id,
        xmid: row.xmid,
        kdh: row.kdh,
        fjr: row.fjr,
        fjsj: row.fjsj,
        sjr: row.sjr,
        sjrdh: row.sjrdh,
        sjdz: row.sjdz,
        kdgs: row.kdgs,
        bz:row.bz
      }
      CURDHelper.Edit(postData, null, `${this.KdApiUrl}`)
        .then(res => {
          VxeUI.modal.message({ content: '编辑数据成功', status: 'success', duration: this.duration })
          let queryConditions = [{
            column: 'xmid',
            content: this.editRow.id,
            condition: '0'
          }]
          this.DoExpressQuery(queryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })

    },
    DoExpressQuery(e) {
      let queryConditions = e || [];
      let request = {
        isPaging: false,
        pageSize: 1,
        pageIndex: 1,
        queryConditions: queryConditions,
        orderByConditions: [{
          column: 'createtime',
          condition: 'asc'
        }]
      }
      CURDHelper.Query(request, this.KdApiUrl)
        .then(res => {
          this.ExpressGridOptions.data = res.data;
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
    DoExpressAdd(row) {
      this.$refs.expressGrid.clearEdit();
      CURDHelper.Add(row, null, `${this.KdApiUrl}`)
        .then(res => {
          VxeUI.modal.message({ content: '新增数据成功', status: 'success', duration: this.duration })
          let queryConditions = [{
            column: 'xmid',
            content: this.editRow.id,
            condition: '0'
          }]
          this.DoExpressQuery(queryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
    DoExpressDelete(row) {
      //删除
      let deleteModel = {
        ID: row.id,
        DeleteRemark: ''
      };
      CURDHelper.DeleteWithConfirm('是否删除当前数据', deleteModel, null, this.KdApiUrl)
        .then(res => {
          VxeUI.modal.message({ content: '删除数据成功', status: 'success', duration: this.duration })
          let queryConditions = [{
            column: 'xmid',
            content: this.editRow.id,
            condition: '0'
          }]
          this.DoExpressQuery(queryConditions);
        }).catch(err => {
          VxeUI.modal.message({ content: err, status: 'error', duration: this.duration })
        })
    },
    handleSupplierGridSelect(row){
      this.ExpensesEditRow.skf = row.qdmc;
      this.ExpensesEditRow.skyh = row.yhmc;
      this.ExpensesEditRow.skzh = row.yhzh;
      this.ExpensesEditRow.skhm = row.hm;
      this.ExpensesEditRow.qdid = row.qdid
      this.qdModal = false;
    },
    GetSupplierData() {
      let request = {
        isPaging: false,
        pageSize: this.PagerConfig.pageSize,
        pageIndex: this.PagerConfig.currentPage,
        queryConditions: [{
          column:'t.qdid',
          condition:'0',
          content:this.editRow.qdid
        }],
        orderByConditions: [{
          column:'t.id',
          condition:'desc'
        }]
      }
      CURDHelper.Query(request, '/api/Xmjcqdxxyhzh/getsupplier')
        .then(res => {
          this.SupplierGridOptions.data = res.data;
        }).catch(err => {
          VxeUI.modal.message({ content: `${err}`, status: 'error', duration: this.duration })
        })
    },
  }
}
